package com.liuxu.topnews.utils;

import android.graphics.Rect;

import com.liuxu.topnews.bean.Point;

import java.util.Random;

public class RandomUntil {
    public RandomUntil() {
    }

    public static String getLargeLetter() {
        return String.valueOf((char)((new Random()).nextInt(27) + 65));
    }

    public static String getLargeLetter(int var0) {
        StringBuffer var2 = new StringBuffer();
        Random var3 = new Random();

        for(int var1 = 0; var1 < var0; ++var1) {
            var2.append((char)(var3.nextInt(27) + 65));
        }

        return var2.toString();
    }

    public static int getNum(int var0) {
        return var0 > 0 ? (new Random()).nextInt(var0) : 0;
    }

    public static int getNum(int var0, int var1) {
        if (var1 != var0 && var1 >= var0) {
            return var1 > var0 ? (new Random()).nextInt(var1 - var0 + 1) + var0 : var0;
        } else {
            return var1;
        }
    }

    public static String getNumLargeLetter(int var0) {
        StringBuffer var2 = new StringBuffer();
        Random var3 = new Random();

        for(int var1 = 0; var1 < var0; ++var1) {
            if (var3.nextInt(2) % 2 == 0) {
                var2.append((char)(var3.nextInt(27) + 65));
            } else {
                var2.append(var3.nextInt(10));
            }
        }

        return var2.toString();
    }

    public static String getNumLargeSmallLetter(int var0) {
        StringBuffer var2 = new StringBuffer();
        Random var3 = new Random();

        for(int var1 = 0; var1 < var0; ++var1) {
            if (var3.nextInt(2) % 2 == 0) {
                if (var3.nextInt(2) % 2 == 0) {
                    var2.append((char)(var3.nextInt(27) + 65));
                } else {
                    var2.append((char)(var3.nextInt(27) + 97));
                }
            } else {
                var2.append(var3.nextInt(10));
            }
        }

        return var2.toString();
    }

    public static String getNumSmallLetter(int var0) {
        StringBuffer var2 = new StringBuffer();
        Random var3 = new Random();

        for(int var1 = 0; var1 < var0; ++var1) {
            if (var3.nextInt(2) % 2 == 0) {
                var2.append((char)(var3.nextInt(27) + 97));
            } else {
                var2.append(var3.nextInt(10));
            }
        }

        return var2.toString();
    }

    public static Point getPoint(Rect rect) {
        Point var1 = new Point();
        var1.x = getNum(rect.left, rect.right);
        var1.y = getNum(rect.top, rect.bottom);
        return var1;
    }

    public static String getSmallLetter() {
        return String.valueOf((char)((new Random()).nextInt(27) + 97));
    }

    public static String getSmallLetter(int var0) {
        StringBuffer var2 = new StringBuffer();
        Random var3 = new Random();

        for(int var1 = 0; var1 < var0; ++var1) {
            var2.append((char)(var3.nextInt(27) + 97));
        }

        return var2.toString();
    }
}
